package com.ruoyi.common.utils.wechat;

/**
 * 微信常量类
 *
 * @Author: HuAnze
 * @Date: 2021/2/8 9:12
 */
public class WeChatConstants {

    /**
     * app_id
     */
    public static final String APP_ID = "wx7f69493ad4f4982e";

    /**
     * 秘钥
     */
    public static final String APP_SECRET = "ea5ebfa3aa75872c1746a3ce89094305";

    /**
     * 用户拒绝授权标识
     */
    public static String REFUSE_CODE = "authdeny";

    /**
     * 微信用户认证请求url
     */
    public static String getOauthUrl(String code) {
        return "https://api.weixin.qq.com/sns/jscode2session?appid=" + APP_ID + "&secret=" + APP_SECRET +
                "&js_code=" + code + "&grant_type=authorization_code";
    }

    public static String getTokenUrl() {
        return "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APP_ID + "&secret=" + APP_SECRET;
    }

}
